package com.yanqu.road.server.cmd.unioncampwar.cross;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.unionCampWar.UnionCampWar;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.unioncampwar.UnionCampWarModule;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.GameProtocol;


@Cmd(code = GameProtocol.S_UNION_CAMP_WAR_BOX_REFRESH_CROSS_BACK, desc = "商帮宝库更新")
public class CrossUnionCampBoxNoticeRefreshBackCmd extends AbstractCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        UnionCampWar.UnionCampWarBoxBigNoticeMsg respMsg = UnionCampWar.UnionCampWarBoxBigNoticeMsg.parseFrom(packet.getBytes());
        for (GamePlayer gamePlayer : GamePlayerMgr.getAllOnlinePlayer()) {
            gamePlayer.sendPacket(ClientProtocol.U_UNION_CAMP_WAR_BOX_REFRESH, respMsg.toBuilder());
        }

    }

    @Override
    public void sendData(GamePlayer player) {
        if (null == player) {
            return;
        }

    }
}
